.TH flux_sum 3  "February 9, 2013" "version 4.0.002" "LPJmL programmers manual"
.SH NAME
flux_sum \- Calculates global carbon and water fluxes
.SH SYNOPSIS
.nf
\fB#include "lpj.h"

Real flux_sum(Flux *\fIflux\fB,const Cell \fIgrid\fB[],const Config *\fIconfig\fB);\fP

.fi
.SH DESCRIPTION
Function calculates global carbon and water fluxes.
The arguments of \fBflux_sum\fP are:
.TP
.I flux
Pointer to flux struct. \fBFlux\fP is defined in \fIoutput.h\fP as follows:
.nf

\fBtypedef struct
{
  Real nep;      /* Total NEP (gC) */
  Real fire;     /* Total fire (gC) */
  Real estab;    /* Total extablishment flux (gC) */
  Real harvest;  /* Total harvested carbon (gC) */
  Real transp;   /* Total transpiration (dm3) */
  Real evap;     /* Total evaporation (dm3) */
  Real interc;   /* Total interception (dm3) */
  Real wd;       /* Total irrigation water withdrawal (dm3) */
  Real wd_unsustainable;      /* Total irrigation water withdrawal from unsustainable sourc
e (dm3) */
  Real wateruse;              /* Total wateruse for household industry and livestock */
  Real discharge;             /* Total discharge (dm3) */
  Real evap_lake;             /* Total evaporation from lakes (dm3) */
  Real evap_res;              /* Total evaporation from reservoirs (dm3) */
  Real irrig;                 /* Total field irrigation (dm3) */
  Real conv_loss;             /* Total evaporation during conveyance (dm3) */
  Real prec;                  /* Total precipitation (dm3) */
  Real delta_surface_storage; /* Total change of surface storage (dm3), increase positive *
/
  Real delta_soil_storage;    /* Total change of soil storage (dm3), increase positive */
  Real area;                  /* Total area (m2) */
  Real total_reservoir_out;   /* Total water extracted from reservoirs for irrigation */
  Real total_irrig_from_reservoir; /*Total water added to fields from reservoirs */
} Flux;
.fi
.TP
.I grid
Cell grid array allocated and initialized by \fBnewgrid()\fP.
.TP
.I config
LPJmL configuration data. Must be read by \fBreadconfig()\fP.
.SH RETURN VALUE
Upon successful completion the total carbon flux in (gC) is returned.

.SH AUTHORS

For authors and contributors see AUTHORS file

.SH COPYRIGHT

(C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file

.SH SEE ALSO
readconfig(3), newgrid(3), fprintflux(3)
